// 管理员系统菜单列表
const adminList = [
  {
    path: '/home',
    name: 'homeMenu',
    meta: {
      hidden: false,
      icon: "home",
      alwaysShow: false,
      i18nKey: 'router.workbench',
      title: '首页',
    },
    component: "Layout",
    redirect: "/home/index",
    children: [
      {
        path: '/home/index',
        name: 'home',
        component: 'views/home/home',
        children: [],
        meta: {
          title: '首页',
          i18nKey: 'router.home',
          keepAlive: false,
          icon: "home",
          affix: true,
        }
      }
    ],
  },
  {
    path: '/live2d',
    name: 'live2d',
    meta: {
      hidden: false,
      icon: "menu",
      alwaysShow: false,
      i18nKey: 'router.live2d',
      title: 'live2d',
    },
    component: "Layout",
    redirect: "/live2d/index",
    children: [
      {
        path: '/live2d/index',
        name: 'live2dPage',
        component: 'views/live2d/index',
        children: [],
        meta: {
          title: 'live2d',
          i18nKey: 'router.live2d',
          keepAlive: false,
          icon: "menu",
          affix: false,
        }
      }
    ],
  },
  {
    path: '/MultiLevelMenu',
    name: 'multiLeve',
    meta: {
      hidden: false,
      title: 'MultiLevelMenu',
      i18nKey: 'router.MultiLevelMenu',
      icon: 'menu'
    },
    component: "Layout",
    children: [
      {
        path: '/MultiLevelMenu/SecondLevel',
        name: 'SecondLevel',
        component: 'views/MultiLevelMenu/SecondLevel',
        children: [],
        meta: {
          hidden: false,
          title: 'SecondLevel',
          i18nKey: 'router.SecondLevel',
          icon: 'menu'
        }
      },
      {
        path: '/MultiLevelMenu/ThirdLevelMenu',
        name: 'ThirdLevelMenu',
        component: 'Layout',
        meta: {
          hidden: false,
          title: 'menu2',
          i18nKey: 'router.ThirdLevelMenu',
          icon: 'menu'
        },
        children: [
          {
            path: '/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-1',
            name: 'ThirdLevelMenu3-1',
            component: 'views/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-1',
            children: [],
            meta: {
              hidden: false,
              title: 'ThirdLevelMenu3-1',
              i18nKey: 'router.ThirdLevelMenu3-1',
              icon: 'menu'
            },
          },
          {
            path: '/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-2',
            name: 'ThirdLevelMenu3-2',
            component: 'views/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-2',
            children: [],
            meta: {
              hidden: false,
              title: 'ThirdLevelMenu3-2',
              i18nKey: 'router.ThirdLevelMenu3-2',
              icon: 'menu'
            },
          },
        ],
      },
    ],
  },
  {
    path: '/manage',
    name: 'manage',
    meta: {
      hidden: false,
      title: '系统管理',
      icon: "menu",
      alwaysShow: true,
      i18nKey: 'router.manage',
      keepAlive: true,
    },
    component: "Layout",
    redirect: "/manage/menu",
    children: [
      {
        path: '/manage/menu',
        name: 'menu',
        component: 'views/manage/menu/menu',
        children: [],
        meta: {
          title: '菜单管理',
          i18nKey: 'router.manage_menu',
          keepAlive: false,
          icon: "menuSetting",
          affix: false,
        }
      },
      {
        path: '/manage/roles',
        name: 'roles',
        component: 'views/manage/roles/roles',
        children: [],
        meta: {
          title: '角色管理',
          i18nKey: 'router.manage_roles',
          keepAlive: false,
          icon: "roles",
          affix: false,
        }
      },
      {
        path: '/manage/user',
        name: 'user',
        component: 'views/manage/user/user',
        children: [],
        meta: {
          title: '用户管理',
          i18nKey: 'router.manage_user',
          keepAlive: false,
          icon: "manageUser",
          affix: false,
        }
      },
    ],
  },
  {
    path: '/about',
    name: 'about',
    meta: {
      hidden: false,
      title: '关于',
      icon: "about",
      alwaysShow: false,
      i18nKey: 'router.about',
      noTagsView: false,
      affix: false,
      isLink: false,
      keepAlive: false,
      roles: ['admin']
    },
    component: "Layout",
    redirect: "/about/index",
    children: [
      {
        path: '/about/index',
        name: 'aboutInfo',
        component: 'views/about/index',
        children: [],
        meta: {
          title: '关于我们',
          i18nKey: 'router.about',
          keepAlive: false,
          icon: "about",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
          roles: ['admin']
        }
      }
    ],
  },
]
// 测试路由列表
const testList = [
  {
    path: '/home',
    name: 'homeMenu',
    meta: {
      hidden: false,
      icon: "home",
      alwaysShow: false,
      i18nKey: 'router.workbench',
      title: '首页',
    },
    component: "Layout",
    redirect: "/home/index",
    children: [
      {
        path: '/home/index',
        name: 'home',
        component: 'views/home/home',
        children: [],
        meta: {
          title: '首页',
          i18nKey: 'router.home',
          keepAlive: false,
          icon: "home",
          affix: true,
        }
      }
    ],
  },
  {
    path: '/live2d',
    name: 'live2d',
    meta: {
      hidden: false,
      icon: "menu",
      alwaysShow: false,
      i18nKey: 'router.live2d',
      title: 'live2d',
    },
    component: "Layout",
    redirect: "/live2d/index",
    children: [
      {
        path: '/live2d/index',
        name: 'live2dPage',
        component: 'views/live2d/index',
        children: [],
        meta: {
          title: 'live2d',
          i18nKey: 'router.live2d',
          keepAlive: false,
          icon: "menu",
          affix: true,
        }
      }
    ],
  },
  {
    path: '/MultiLevelMenu',
    name: 'multiLeve',
    meta: {
      hidden: false,
      title: 'MultiLevelMenu',
      i18nKey: 'router.MultiLevelMenu',
      icon: 'menu'
    },
    component: "Layout",
    children: [
      {
        path: '/MultiLevelMenu/SecondLevel',
        name: 'SecondLevel',
        component: 'views/MultiLevelMenu/SecondLevel',
        children: [],
        meta: {
          hidden: false,
          title: 'SecondLevel',
          i18nKey: 'router.SecondLevel',
          icon: 'menu'
        }
      },
      {
        path: '/MultiLevelMenu/ThirdLevelMenu',
        name: 'ThirdLevelMenu',
        component: 'Layout',
        meta: {
          hidden: false,
          title: 'menu2',
          i18nKey: 'router.ThirdLevelMenu',
          icon: 'menu'
        },
        children: [
          {
            path: '/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-1',
            name: 'ThirdLevelMenu3-1',
            component: 'views/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-1',
            children: [],
            meta: {
              hidden: false,
              title: 'ThirdLevelMenu3-1',
              i18nKey: 'router.ThirdLevelMenu3-1',
              icon: 'menu'
            },
          },
          {
            path: '/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-2',
            name: 'ThirdLevelMenu3-2',
            component: 'views/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-2',
            children: [],
            meta: {
              hidden: false,
              title: 'ThirdLevelMenu3-2',
              i18nKey: 'router.ThirdLevelMenu3-2',
              icon: 'menu'
            },
          },
        ],
      },
    ],
  },
  {
    path: '/about',
    name: 'about',
    meta: {
      hidden: false,
      title: '关于我们',
      icon: "about",
      alwaysShow: false,
      i18nKey: 'router.about',
      noTagsView: false,
      affix: false,
      isLink: false,
      keepAlive: false,
      roles: ['admin']
    },
    component: "Layout",
    redirect: "/about/index",
    children: [
      {
        path: '/about/index',
        name: 'aboutInfo',
        component: 'views/about/index',
        children: [],
        meta: {
          title: '关于我们',
          i18nKey: 'router.about',
          keepAlive: false,
          icon: "about",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
          roles: ['admin']
        }
      }
    ],
  },
]
// 系统路由列表
const sysMenuTree = [
  {
    path: '/home',
    name: 'homeMenu',
    hidden: false,
    icon: "home",
    alwaysShow: false,
    i18nKey: 'router.workbench',
    title: '首页',
    orderNum: 0,
    parentId: 0,
    menuId: 1,
    noTagsView: false,
    affix: false,
    isLink: false,
    keepAlive: false,
    meta: {
      hidden: false,
      icon: "home",
      alwaysShow: false,
      i18nKey: 'router.workbench',
      title: '首页',
      noTagsView: false,
      affix: false,
      isLink: false,
      keepAlive: false,
    },
    component: "Layout",
    redirect: "/home/index",
    children: [
      {
        path: '/home/index',
        name: 'home',
        component: 'views/home/home',
        children: [],
        title: '首页',
        i18nKey: 'router.home',
        keepAlive: false,
        icon: "home",
        affix: true,
        orderNum: 0,
        parentId: 1,
        menuId: 2,
        noTagsView: false,
        isLink: false,
        alwaysShow: false,
        hidden: false,
        meta: {
          title: '首页',
          i18nKey: 'router.home',
          keepAlive: false,
          icon: "home",
          affix: true,
          isLink: false,
        }
      }
    ],
  },
  {
    path: '/MultiLevelMenu',
    name: 'multiLeve',
    meta: {
      hidden: false,
      title: '多级菜单',
      i18nKey: 'router.MultiLevelMenu',
      icon: 'menu'
    },
    hidden: false,
    title: '多级菜单',
    i18nKey: 'router.MultiLevelMenu',
    icon: 'menu',
    component: "Layout",
    orderNum: 0,
    parentId: 0,
    menuId: 3,
    noTagsView: false,
    affix: false,
    keepAlive: false,
    isLink: false,
    alwaysShow: false,
    children: [
      {
        path: '/MultiLevelMenu/SecondLevel',
        name: 'secondLevel',
        component: 'views/MultiLevelMenu/SecondLevel',
        children: [],
        meta: {
          hidden: false,
          title: 'SecondLevel',
          i18nKey: 'router.SecondLevel',
          icon: 'menu'
        },
        orderNum: 0,
        parentId: 3,
        menuId: 4,
        noTagsView: false,
        affix: false,
        keepAlive: false,
        hidden: false,
        isLink: false,
        alwaysShow: false,
        title: '二级页面',
        i18nKey: 'router.SecondLevel',
        icon: 'menu'
      },
      {
        path: '/MultiLevelMenu/ThirdLevelMenu',
        name: 'ThirdLevelMenu',
        component: 'Layout',
        meta: {
          hidden: false,
          title: 'menu2',
          i18nKey: 'router.ThirdLevelMenu',
          icon: 'menu'
        },
        orderNum: 0,
        parentId: 3,
        menuId: 5,
        noTagsView: false,
        affix: false,
        keepAlive: false,
        hidden: false,
        isLink: false,
        alwaysShow: false,
        title: '三级菜单',
        i18nKey: 'router.ThirdLevelMenu',
        icon: 'menu',
        children: [
          {
            path: '/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-1',
            name: 'ThirdLevelMenu3-1',
            component: 'views/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-1',
            children: [],
            meta: {
              hidden: false,
              title: '三级菜单3-1',
              i18nKey: 'router.ThirdLevelMenu3-1',
              icon: 'menu'
            },
            orderNum: 0,
            parentId: 5,
            menuId: 6,
            noTagsView: false,
            affix: false,
            keepAlive: false,
            hidden: false,
            isLink: false,
            alwaysShow: false,
            title: '三级页面3-1',
            i18nKey: 'router.ThirdLevelMenu3-1',
            icon: 'menu'
          },
          {
            path: '/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-2',
            name: 'ThirdLevelMenu3-2',
            component: 'views/MultiLevelMenu/ThirdLevelMenu/ThirdLevelMenu3-2',
            children: [],
            meta: {
              hidden: false,
              title: '三级菜单3-2',
              i18nKey: 'router.ThirdLevelMenu3-2',
              icon: 'menu'
            },
            orderNum: 0,
            parentId: 5,
            menuId: 7,
            noTagsView: false,
            affix: false,
            keepAlive: false,
            hidden: false,
            isLink: false,
            alwaysShow: false,
            title: '三级页面3-2',
            i18nKey: 'router.ThirdLevelMenu3-2',
            icon: 'menu'
          },
        ],
      },
    ],
  },
  {
    path: '/manage',
    name: 'manage',
    hidden: false,
    title: '系统管理',
    icon: "menu",
    alwaysShow: true,
    i18nKey: 'router.manage',
    orderNum: 0,
    parentId: 0,
    menuId: 11,
    noTagsView: false,
    affix: false,
    isLink: false,
    keepAlive: false,
    meta: {
      hidden: false,
      title: '系统管理',
      icon: "menu",
      alwaysShow: true,
      i18nKey: 'router.manage',
      noTagsView: false,
      affix: false,
      isLink: false,
      keepAlive: false,
    },
    component: "Layout",
    redirect: "/manage/menu",
    children: [
      {
        path: '/manage/menu',
        name: 'manage_menu',
        component: 'views/manage/menu/menu',
        children: [],
        title: '菜单管理',
        i18nKey: 'router.manage_menu',
        keepAlive: false,
        icon: "menuSetting",
        affix: false,
        orderNum: 0,
        parentId: 11,
        menuId: 12,
        noTagsView: false,
        isLink: false,
        alwaysShow: false,
        hidden: false,
        meta: {
          title: '菜单管理',
          i18nKey: 'router.manage_menu',
          keepAlive: false,
          icon: "menuSetting",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
        }
      },
      {
        path: '/manage/roles',
        name: 'roles',
        component: 'views/manage/roles/roles',
        children: [],
        title: '角色管理',
        i18nKey: 'router.manage_roles',
        keepAlive: false,
        icon: "roles",
        affix: false,
        orderNum: 0,
        parentId: 11,
        menuId: 13,
        noTagsView: false,
        isLink: false,
        alwaysShow: false,
        hidden: false,
        meta: {
          title: '角色管理',
          i18nKey: 'router.manage_roles',
          keepAlive: false,
          icon: "roles",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
        }
      },
      {
        path: '/manage/user',
        name: 'user',
        component: 'views/manage/user/user',
        children: [],
        title: '用户管理',
        i18nKey: 'router.manage_user',
        keepAlive: false,
        icon: "manageUser",
        affix: false,
        orderNum: 0,
        parentId: 11,
        menuId: 14,
        noTagsView: false,
        isLink: false,
        alwaysShow: false,
        hidden: false,
        meta: {
          title: '用户管理',
          i18nKey: 'router.manage_user',
          keepAlive: false,
          icon: "manageUser",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
        }
      }
    ],
  },
  {
    path: '/about',
    name: 'about',
    meta: {
      hidden: false,
      title: '关于我们',
      icon: "about",
      alwaysShow: false,
      i18nKey: 'router.about',
      noTagsView: false,
      affix: false,
      isLink: false,
      keepAlive: false,
      roles: ['admin']
    },
    component: "Layout",
    redirect: "/about/index",
    hidden: false,
    title: '关于我们',
    icon: "about",
    alwaysShow: false,
    i18nKey: 'router.about',
    noTagsView: false,
    affix: false,
    isLink: false,
    keepAlive: false,
    roles: ['admin'],
    orderNum: 0,
    parentId: 0,
    menuId: 15,
    children: [
      {
        path: '/about/index',
        name: 'aboutInfo',
        component: 'views/about/index',
        children: [],
        title: '关于我们',
        i18nKey: 'router.about',
        keepAlive: false,
        icon: "about",
        affix: false,
        noTagsView: false,
        isLink: false,
        alwaysShow: false,
        hidden: false,
        roles: ['admin'],
        orderNum: 0,
        parentId: 15,
        menuId: 16,
        meta: {
          title: '关于我们',
          i18nKey: 'router.about',
          keepAlive: false,
          icon: "about",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
          roles: ['admin']
        }
      }
    ],
  },
  {
    path: '/live2d',
    name: 'live2d',
    meta: {
      hidden: false,
      title: 'live2d',
      icon: "menu",
      alwaysShow: false,
      i18nKey: 'router.live2d',
      noTagsView: false,
      affix: false,
      isLink: false,
      keepAlive: false,
      roles: ['admin']
    },
    component: "Layout",
    redirect: "/live2d/index",
    hidden: false,
    title: 'live2d',
    icon: "menu",
    alwaysShow: false,
    i18nKey: 'router.live2d',
    noTagsView: false,
    affix: false,
    isLink: false,
    keepAlive: false,
    roles: ['admin'],
    orderNum: 0,
    parentId: 0,
    menuId: 16,
    children: [
      {
        path: '/live2d/index',
        name: 'live2dPage',
        component: 'views/live2d/index',
        children: [],
        title: 'live2d',
        i18nKey: 'router.live2d',
        keepAlive: false,
        icon: "menu",
        affix: false,
        noTagsView: false,
        isLink: false,
        alwaysShow: false,
        hidden: false,
        roles: ['admin'],
        orderNum: 0,
        parentId: 16,
        menuId: 17,
        meta: {
          title: 'live2d',
          i18nKey: 'router.live2d',
          keepAlive: false,
          icon: "menu",
          affix: false,
          noTagsView: false,
          isLink: false,
          alwaysShow: false,
          hidden: false,
          roles: ['admin']
        }
      }
    ],
  },
]

export default [
  // 根据token查询接口
  {
    url: '/mock/sysMenu/sysMenuTreeByToken',
    method: 'post',
    response: ({ body }: any) => {
      const { roles } = body
      return {
        code: 200,
        data: roles.includes('admin') ? adminList : testList
      }
    }
  },
  // 查询接口
  {
    url: '/mock/sysMenu/sysMenuTree',
    method: 'post',
    timeout: 500,
    response: ({ body }: any) => {
      return {
        code: 200,
        data: sysMenuTree
      }
    }
  },
  // 新增接口
  {
    url: '/mock/sysMenu/addSysMenu',
    method: 'post',
    response: ({ body }: any) => {
      return {
        code: 201,
        data: null,
        msg: '演示模式无法操作'
      }
    }
  },
  // 删除接口
  {
    url: '/mock/sysMenu/removeSysMenuAndSysRoleMenuByMenuId',
    method: 'post',
    response: ({ body }: any) => {
      return {
        code: 201,
        data: null,
        msg: '演示模式无法操作'
      }
    }
  },
  // 根据角色编码获取系统菜单id列表
  {
    url: '/mock/sysMenu/getMenuIdByRoleCode',
    method: 'post',
    response: ({ query }: any) => {

      const { roleCode } = query

      return {
        code: 200,
        data: roleCode == 'admin' ? [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15] : [1, 2, 3, 15],
        msg: '成功'
      }
    }
  },
  // 根据id更新单条系统菜单
  {
    url: '/mock/sysMenu/updateSysMenuById',
    method: 'post',
    response: ({ body }: any) => {
      return {
        code: 201,
        data: null,
        msg: '演示模式无法操作'
      }
    }
  },

]